; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a
; semicolon, such as this one, are comments.  They are not executed.

; This script has a special filename and path because it is automatically
; launched when you run the program directly.  Also, any text file whose
; name ends in .ahk is associated with the program, which means that it
; can be launched simply by double-clicking it.  You can have as many .ahk
; files as you want, located in any folder.  You can also run more than
; one .ahk file simultaneously and each will get its own tray icon.

; SAMPLE HOTKEYS: Below are two sample hotkeys.  The first is Win+Z and it
; launches a web site in the default browser.  The second is Control+Alt+N
; and it launches a new Notepad window (or activates an existing one).  To
; try out these hotkeys, run AutoHotkey again, which will load this file.
^!i::
IfWinExist Project Explorer (University Edition)
	WinActivate
else
	MsgBox, Please open Core Project Explorer

IfWinExist Element Extractor (University Edition)
{
	WinActivate
}
else
{
	Send !t
	Send {Down}
	Send {Enter}
}
sleep, 1000

IfWinExist Element Extractor (University Edition)
{
	WinActivate
}
else
	MsgBox, FAIL Element Extractor

ControlGet, text, Choice,, ComboBox5

While (text <> "Requirement")
{
	MsgBox, Set Failed. Please Set Class to Requirement %text%.
        ControlGet, text, Choice,, ComboBox5
}


IfWinExist Microsoft Excel - Requirements.csv
	WinActivate
else
	MsgBox, Please open Requirements.csv
clipboard = 
Send ^{Home}
Send {Right}
clipboard = 
Send ^c
ClipWait
clipboard = %clipboard%

While (clipboard <> "")
{
	IfWinExist Element Extractor (University Edition)
		WinActivate
	else
		MsgBox, Please open Core->Tools->Element Extractor and set class to requirements.
	
	Send ^v
	Send {Tab}
	Send {Tab}
	Send ^v
	Send +{Tab}
	
	IfWinExist Microsoft Excel - Requirements.csv
		WinActivate
	else
		MsgBox, Please open Requirements.csv

	Send {Left}
	clipboard = 
	Send ^c
	ClipWait
	clipboard = %clipboard%
	
	IfWinExist Element Extractor (University Edition)
		WinActivate
	else
		MsgBox, Please open Core->Tools->Element Extractor and set class to requirements.
	Send ^v
	Send ^e
	Send {Tab}
	Sleep 300
	Send ^a
	Sleep 300
	Send {Delete}
	Send +{Tab}
	Sleep 300
	Send ^a
	Sleep 300
	Send {Delete}
	Send +{Tab}
	Sleep 300
	Send ^a
	Sleep 300
	Send {Delete}

	IfWinExist Microsoft Excel - Requirements.csv
		WinActivate
	else
		MsgBox, Please open Requirements.csv
	Send {Down}
	Send {Right}	
	clipboard = 
	Send ^c
	ClipWait
	clipboard = %clipboard%
}


MsgBox, Done

return

#z::Run www.autohotkey.com

^!n::
IfWinExist Untitled - Notepad
	WinActivate
else
	Run Notepad
return
